<?php
/*******************************************************************************
 * $Date:: Jan 24, 2011 4:24:31 PM                                              $
 * $Revision:                                                                  $
 * $Author:: Tuan Duong                                                        $
 * $Comment::                                                                  $
 ******************************************************************************/ 
/**
 * Description here...
 * 
 * @package Lua
 * @subpackage ##Subpackage##
 * @author Tuan Duong <bacduong[at]gmail[dot]com>
 * @version 
 */

class Lua_Form_Admin_Select extends Lua_Form_Admin
{
    public function init()
    {
        parent::init();

        $this->addElement('select', 'group_id', array(
            'label' => 'Groups',
            'required' => true,
        ));
    }

    public function setAvaiableGroups($groups)
    {
        $options = array();
        foreach ($groups as $group) {
            $options[$group['id']] = $group['name'];
        }

        $this->group_id->setMultiOptions($options);
        $this->group_id->setValue(array_keys($options));
    }
}